import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
import Layout from '../Layout/index.vue'

Vue.use(VueRouter)

export const routes = [
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/',
    name: 'index',
    redirect:"/home",
    component:Layout,
    meta:{
      title:"首页",
      icon:"el-icon-document-copy",
      noDropDown: true
    },
    children:[
      {
        path: '/home',
        name: 'home',
        component:() => import(/* webpackChunkName: "about" */ '../views/Home'),
       
      }
    ]
    //  () => import(/* webpackChunkName: "about" */ '../views/Home')
  },
  {
    path: '/blog',
    name: 'blog',
    component:Layout,
    meta:{
      title:"博客管理",
      icon:"el-icon-document-copy",
      noDropDown: false
    },
    children:[
      {
        path: '/blogdata',
        name: 'blogdata',
        component:() => import(/* webpackChunkName: "about" */ '../views/blogdata'),
        meta:{
          title:"文章分析",
          icon:"el-icon-document-copy",
          noDropDown: false
        },
      },
      {
        path: '/bloglist',
        name: 'bloglist',
        component:() => import(/* webpackChunkName: "about" */ '../views/bloglist'),
        meta:{
          title:"博客列表",
          icon:"el-icon-document-copy",
          noDropDown: false
        },
      }
    ],
    
  },
  {
    path: '/link',
    name: 'link',
    component:Layout,
    meta:{
      title:"友链管理",
      icon:"el-icon-document-copy",
      noDropDown: false
    },
    children:[
      {
        path: '/linklist',
        name: 'linklist',
        component:() => import(/* webpackChunkName: "about" */ '../views/linklist'),
        meta:{
          title:"友链列表",
          icon:"el-icon-document-copy",
          noDropDown: false
        }
      },{
        path: '/linkupload',
        name: 'linkupload',
        component:() => import(/* webpackChunkName: "about" */ '../views/linkupload'),
        meta:{
          title:"友链中心",
          icon:"el-icon-document-copy",
          noDropDown: false
        }
      }
    ],
  },
  {
    path: '/set',
    name: 'set',
    component:Layout,
    meta:{
      title:"系统设置",
      icon:"el-icon-document-copy",
      noDropDown: false
    },
    children:[
      {
        path: '/particle',
        name: 'particle',
        component:() => import(/* webpackChunkName: "about" */ '../views/particle'),
        meta:{
          title:"粒子设置",
          icon:"el-icon-document-copy",
          noDropDown: false
        }
      },{
        path: '/layout',
        name: 'layout',
        component:() => import(/* webpackChunkName: "about" */ '../views/layout'),
        meta:{
          title:"主题设置",
          icon:"el-icon-document-copy",
          noDropDown: false
        }
      }
    ],
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
